﻿@model S4Store.Models.Decorate.PersonDetailModel
 @{
     Layout = null;
     ViewBag.Title = "PersonDetail";
}
<div style="height:100%; overflow:auto">
@Html.Action("ReportBar", "Common", Model.BarModel)

 <table  style="border-collapse:collapse; width:100%" class="reporttable">
 
 <tr>
  <th>销售顾问名称</th>
  <th>车型</th>
  <th>当月累计交车数</th>
  <th>套餐车销售数量</th>
  <th>装潢车销售总数</th>
  <th>装潢车装潢销售额(万)</th>
  <th>套餐车销售率</th>
  <th>有效装潢车销售率</th>
  <th>平均单车装潢额(万)</th>
 </tr>
   @for (var i = 0; i < Model.Reports.Count; i++)
   {
       var report = Model.Reports[i];
 <tr>
    @if (i == 0)
    {
   <td rowspan="@Model.Reports.Count">@Model.Employee.Name</td>
    }
    <td>@report.CarBrand.Name</td> 
    <td>@report.JCS</td>  
    <td>@report.TCCXSSL</td>  
    <td>@report.YXZHCXSSL</td>  
    <td>@report.ZHCZHXSE.toInt()</td>  
    <td @S4Store.Utils.GetBgColor(report.TCCXSLV>=Model.SellerPerformanceStandard.TCCXSLV)>@report.TCCXSLV.toInt()%</td>  
    <td @S4Store.Utils.GetBgColor(report.YXZHCXSLV>=Model.SellerPerformanceStandard.YXZHCXSLV)>@report.YXZHCXSLV.toInt()%</td>  
    <td @S4Store.Utils.GetBgColor(report.PJDCZHE >= Model.SellerPerformanceStandard.PJDCZHE)>@report.PJDCZHE.toInt()</td>  
 </tr>     
   }
   <tr>
    <th colspan="2">小计</th>
    <td>@Model.Reports.Sum(t=>t.JCS)</td>
    <td>@Model.Reports.Sum(t => t.TCCXSSL).toInt()</td>
    <td>@Model.Reports.Sum(t => t.YXZHCXSSL).toInt()</td>
    <td>@Model.Reports.Sum(t => t.ZHCZHXSE).toInt()</td>
    <td @S4Store.Utils.GetBgColor(Model.Report.TCCXSLV >= Model.SellerPerformanceStandard.TCCXSLV)>@Model.Report.TCCXSLV.toInt()%</td>
    <td @S4Store.Utils.GetBgColor(Model.Report.YXZHCXSLV >= Model.SellerPerformanceStandard.YXZHCXSLV)>@Model.Report.YXZHCXSLV.toInt()%</td>
    <td @S4Store.Utils.GetBgColor(Model.Report.PJDCZHE >= Model.SellerPerformanceStandard.PJDCZHE)>@Model.Report.PJDCZHE.toInt()</td>
   </tr>
   <tr>
    <th colspan="6">考核目标</th>
    <td>@Model.SellerPerformanceStandard.TCCXSLV.toInt()%</td>
    <td>@Model.SellerPerformanceStandard.YXZHCXSLV.toInt()%</td>
    <td>@Model.SellerPerformanceStandard.PJDCZHE.toInt()</td>
   </tr>
 </table>

</div>